package xq.pug.feign.service.authorzation;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import xq.pug.feign.dto.authorization.AuthorizationDTO;

/**
 * @author RenGaoshuai
 * @date 2023/7/10 17:41
 * @description
 */
@FeignClient(value = "authorization-service")
public interface TokenServiceFeign {

    /**
     * 该接口为oauth2自带的接口，格式固定
     * 返回格式也固定
     *
     * @param scope 空间
     * @param grantType 授权模式
     * @param authorization 客户端账号（请求头）
     * @return token信息
     */
    @ApiOperation(value = "获取token", notes = "获取token")
    @PostMapping("/oauth/token")
    AuthorizationDTO getToken(@RequestParam("scope") String scope, @RequestParam("grant_type") String grantType, @RequestParam("client_id") String ClientId, @RequestParam("client_secret") String secret);

}
